﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common.Master" AutoEventWireup="true"
    CodeBehind="ArchiveBorrowApplyTree.aspx.cs" Inherits="Web.Views.ArchiveBorrow.ArchiveBorrowApplyTree" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            //加载公司通讯录Tree
            var userid = $("#ctl00_ContentPlaceHolder1_hdUserId").val();
            var timestamp = new Date().getTime();
            var isbase = getQueryString("isbase");
            if (isbase != null) {
                isbase = ",and,isbase=" + isbase;
            } else {
                isbase = "";
            }
            $('#treeArchiveMenu').tree({
                method: "get",
                lines: true,
                idFiled: "id",
                textFiled: "text",
                parentField: "pid",
                cascadeCheck: false,
                url: "../../../HttpHandles/ArchiveHandle.ashx?archivemenu=yes&userid=" + userid + "&timestamp=" + timestamp + "&archiveBorrow=facial",
                onBeforeExpand: function (node, param) {
                },
                onLoadSuccess: function (node, data) {
                    window.parent.document.getElementById('Iframe1').src = "../../SystemLogin/loadingpage.aspx?Menu_URL=../ArchiveBorrow/ArchiveBorrowApply/ArchiveBorrowApplyList.aspx?archiveType=" + data[0].children[0].id + isbase;
                }
              ,
                onSelect: function (node) {
                    if ($('#treeArchiveMenu').tree('isLeaf', node.target)) {
                        //判断是否为归档的树
                        if ($("#hdFileType").val() != "") {
                            window.parent.document.getElementById('Iframe1').src = "../../SystemLogin/loadingpage.aspx?Menu_URL=../ArchiveBorrow/ArchiveBorrowApply/ArchiveBorrowApplyList.aspx?archiveType=" + node.id + isbase;
                        }
                        else {
                            window.parent.document.getElementById('Iframe1').src = "../../SystemLogin/loadingpage.aspx?Menu_URL=../../ArchiveBorrow/ArchiveBorrowApply/ArchiveBorrowApplyList.aspx?archiveType=" + node.id + isbase;
                        }
                    }
                }
            });
        });

        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ul id="treeArchiveMenu">
    </ul>
    <asp:HiddenField ID="hdFileType" runat="server" />
    <asp:HiddenField ID="hdUserId" runat="server" Value="" />
</asp:Content>
